<?php

class Address_infoModel extends Model {
	
	public function get_primary_key() {
		return $this->primary_key = 'id';
	}
	public function get_paisong_list(){
		
	}

    public function set($id, $data) {
        if ($id) {
            $this->db->where('id', $id);
            $this->db->update('member_info', $data);
            return $id;
        }
        $return = $this->db->insert('member_info', $data);
        if ($return) return $return;
        return false;
    }

    public function del($member_id,$id)
    {
        $this->db->delete('member_info',array('id'=>$id,'member_id'=>$member_id));
        return $id;
    }

    public function get_all($where)
    {
        $sql = "select * from " . $this->prefix . "member_info where $where";
        return $this->db->query($sql)->result_array();
    }

    public function get_one($where)
    {
        $sql = "select * from " . $this->prefix . "member_info where $where";
        return $this->db->query($sql)->row_array();
    }
	
	
}